package oop4;

import java.util.Objects;

/**
 * @author oldliu
 * @since 1.0
 */
//宠物
public  class Pet {
    private String name;
    private int health;
    private int love;
    private String sex;
    protected String color;
    public Pet(){
        System.out.println("pet的无参构造方法");
    }

    public Pet(String name, int health, int love, String sex) {
        this.name = name;
        this.health = health;
        this.love = love;
        this.sex = sex;
    }
    public void print(){
        System.out.println("这个宠物叫"+name);
        System.out.println("性别是"+sex);
        System.out.println("健康程度："+health);
        System.out.println("可爱程度："+love);
        System.out.println("颜色是："+color);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

//    @Override
//    public boolean equals(Object o) {
//        if (this == o) return true;
//        if (o == null || getClass() != o.getClass()) return false;
//        Pet pet = (Pet) o;
//        return Objects.equals(name, pet.name) &&
//                Objects.equals(sex, pet.sex);
//    }
//
//    @Override
//    public int hashCode() {
//        return Objects.hash(name, sex);
//    }
}
